#!/bin/bash

# 安装nftables
if command -v apt-get >/dev/null 2>&1; then
    # Debian/Ubuntu
    apt-get install nftables -y
elif command -v yum >/dev/null 2>&1; then
    # CentOS/RHEL
    yum install nftables -y
elif command -v dnf >/dev/null 2>&1; then
    # Fedora
    dnf install nftables -y
else
    echo "错误：无法确定包管理器类型"
    exit 1
fi

# 启用并启动nftables服务
systemctl enable nftables
systemctl start nftables

echo "nftables配置完成"

